<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Users_Default" Title="Users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="50%"
            Width="50%" BackColor="#ACACAC" Transparency="10" MinDisplayTime="4" InitialDelayTime="0">
            <img style="margin-top: 150px;" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading6.gif") %>' />
    </telerik:RadAjaxLoadingPanel>
    <div class="actionButtons clearfix">
        <div class="floatRight">
            <acms:ActionButton ID="lnkCreate" runat="server" NavigateUrl="~/Users/Create.aspx" Text="Create New User" />
        </div>
    </div>
    <telerik:RadGrid ID="gridUsers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="dsUsers" GridLines="None" PageSize="15" Skin="Telerik" AllowAutomaticDeletes="true" AllowAutomaticInserts="true">
        <PagerStyle Mode="Slider" Position="TopAndBottom" />
        <MasterTableView DataKeyNames="Id,ConcurencyId" DataSourceID="dsUsers">
            <RowIndicatorColumn Visible="true">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn Resizable="False" Visible="False">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <%#Container.DataSetIndex + 1%>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="UserName" HeaderText="Username" SortExpression="UserName"
                    UniqueName="UserName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" ReadOnly="True"
                    SortExpression="DisplayName" UniqueName="DisplayName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DateOfBirth" DataFormatString="{0:d}" DataType="System.DateTime"
                    HeaderText="Date Of Birth" SortExpression="DateOfBirth" UniqueName="DateOfBirth">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email" SortExpression="EmailAddress"
                    UniqueName="EmailAddress">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="MobileTel" HeaderText="Mobile" SortExpression="MobileTel"
                    UniqueName="MobileTel">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Created" DataType="System.DateTime" HeaderText="Registered"
                    ReadOnly="True" SortExpression="Created" UniqueName="Created">
                </telerik:GridBoundColumn>
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Users/Details.aspx?ID={0}" Text="More Details" />
                <telerik:GridButtonColumn ButtonType="LinkButton" Text="Delete" ConfirmDialogType="RadWindow" ConfirmText="Are you sure?" CommandName="Delete" UniqueName="DeleteColumn" />
            </Columns>
            <EditFormSettings>
                <PopUpSettings ScrollBars="None" />
            </EditFormSettings>
            <PagerStyle Mode="Slider" />
        </MasterTableView>
    </telerik:RadGrid>
    <acms:DownloadingGrid ID="gridDownload" DataSourceID="dsUsers" FileName="Users" CsvIcon="~/icons/csv_16_16.gif" ExcelIcon="~/icons/xls_16_16.gif" XmlIcon="~/icons/xml_16_16.gif" runat="server">
        <Columns>
            <acms:DownloadGridField HeaderText="Username" DataField="UserName" />
            <acms:DownloadGridField HeaderText="First Name" DataField="FirstName" />
            <acms:DownloadGridField HeaderText="Last Name" DataField="LastName" />
            <acms:DownloadGridField HeaderText="Date Of Birth" DataField="DateOfBirth" Format="{0:d}" />
            <acms:DownloadGridField HeaderText="Email" DataField="EmailAddress" />
            <acms:DownloadGridField HeaderText="Gender" DataField="Gender" />
            <acms:DownloadGridField HeaderText="Address 1" DataField="Address1" />
            <acms:DownloadGridField HeaderText="Address 2" DataField="Address2" />
            <acms:DownloadGridField HeaderText="Town" DataField="Town" />
            <acms:DownloadGridField HeaderText="Post Code" DataField="PostCode" />
            <acms:DownloadGridField HeaderText="Mobile" DataField="MobileTel" />
            <acms:DownloadGridField HeaderText="Registered" DataField="Created" />        </Columns>
    </acms:DownloadingGrid>
    <acms:UserDataSource ID="dsUsers" runat="server" EnablePaging="False" OnSelectData="dsUsers_SelectData">
    </acms:UserDataSource>
</asp:Content>

